// personalData.js
var app = getApp()
Page({

    /**
     * 页面的初始数据
     */
    data: {
        show: 'none',
        showAge: 'none',
        showEducation: 'none',
        showphoneNum: 'none',
        age: '23',
        Education: '本科',
        phoneNum: 12389456457
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {
        console.log(options)

        var that = this

        //调用应用实例的方法获取全局数据
        app.getUserInfo(function(userInfo) {
            //更新数据
            that.setData({
                userInfo: userInfo,
                mobile: that.options.mobile
            })
        })
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function() {

    },

    /**
     * 生命周期函数--监听页面卸载
     */
    onUnload: function() {

    },

    /**
     * 页面相关事件处理函数--监听用户下拉动作
     */
    onPullDownRefresh: function() {

    },

    /**
     * 页面上拉触底事件的处理函数
     */
    onReachBottom: function() {

    },

    /**
     * 用户点击右上角分享
     */
    onShareAppMessage: function() {

    },
    bindshowAge: function() {
        this.setData({
            show: 'block',
            showAge: 'block'
        })
    },
    bindshowphoneNum: function() {
        this.setData({
            show: 'block',
            showphoneNum: 'block'
        })
    },
    bindshowEducation: function() {
        this.setData({
            show: 'block',
            showEducation: 'block'
        })
    },

    bindAgeSubmit: function() {
        if (!this.data.Age == '') {
            this.setData({
                show: 'none',
                age: this.data.Age,
                showAge: 'none'
            })
        }
        this.setData({
            show: 'none',
            showAge: 'none'
        })
    },
    bindEducationSubmit: function() {
        if (!this.data.Educate == '') {
            this.setData({
                show: 'none',
                Education: this.data.Educate,
                showEducation: 'none'
            })
        }
        this.setData({
            show: 'none',
            showEducation: 'none'
        })
    },
    bindphoneNumSubmit: function() {
        if (!this.data.PhoneNumber == '') {
            this.setData({
                show: 'none',
                phoneNum: this.data.PhoneNumber,
                showphoneNum: 'none'
            })
        }
        this.setData({
            show: 'none',
            showphoneNum: 'none'
        })
    },
    inputEvent1: function(e) {
        this.setData({
            Age: e.detail.value
        })
    },
    inputEvent2: function(e) {
        this.setData({
            Educate: e.detail.value
        })
    },
    inputEvent3: function(e) {
        this.setData({
            PhoneNumber: e.detail.value
        })
    }


})